import java.util.Scanner;

public class Test {
    static class Counter{
        public int count;
    }
    public static void main(String[] args) {
        Counter counter = new Counter();
        Thread t1 = new Thread(() -> {
            while (counter.count == 0){
                
            }
            System.out.println("t1线程结束");
        });
        t1.start();
 
        Thread t2 = new Thread(() -> {
            System.out.println("修改count的值");
            Scanner scanner = new Scanner(System.in);
            counter.count = scanner.nextInt();
            System.out.println("count = " + counter.count);
        });
        t2.start();
    }
}